MANPAGES += doc/ostree.1
-if ENABLE_KERNEL_UPDATES
+if ENABLE_GRUB2_HOOK
grub2dir = $(sysconfdir)/grub.d
grub2_SCRIPTS = src/ostree/grub2/15_ostree
+endif
+
+if ENABLE_KERNEL_UPDATES
+
kernelpostinstdir = $(sysconfdir)/kernel/postinst.d
kernelpostinst_SCRIPTS = src/ostree/kernel/15_ostree_update
], [ with_libarchive=no ])
AM_CONDITIONAL(USE_LIBARCHIVE, test $with_libarchive != no)
-AS_IF([test x$cross_compiling != xyes && test -d /etc/kernel && test x$enable_triggers_only != xno ],
+AS_IF([test x$cross_compiling != xyes && test -d /etc/kernel && test x$enable_triggers_only != xyes ],
[kernel_updates_default=yes],
[kernel_updates_default=no])
enable_kernel_updates=${kernel_updates_default})
AM_CONDITIONAL(ENABLE_KERNEL_UPDATES, test $enable_kernel_updates != no)
+AS_IF([test x$cross_compiling != xyes && test -d /etc/grub.d && test x$enable_triggers_only != xyes ],
+ [grub2_hook_default=yes],
+ [grub2_hook_default=no])
+
+AC_ARG_ENABLE(grub2-hook,
+ AS_HELP_STRING([--enable-grub2-hook],
+ [Install GRUB2 hook]), ,
+ enable_grub2_hook=${grub2_hook_default})
+AM_CONDITIONAL(ENABLE_GRUB2_HOOK, test $enable_grub2_hook != no)
+
AC_CONFIG_FILES([
Makefile
embedded-dependencies/Makefile
libarchive (parse tar files directly): $with_libarchive
documentation: $enable_documentation
kernel updates integration: $enable_kernel_updates
+ GRUB2 hook: $enable_grub2_hook
"